<template>
	<view>
		<studentInfo ref="studentInfo" v-show="PageCur=='studentInfo'"></studentInfo>
		<workbench v-if="PageCur=='workbench'"></workbench>
		<person v-if="PageCur=='my'"></person>
		<view class="cu-bar tabbar bg-white shadow foot">
			<view class="action" @click="NavChange" data-cur="studentInfo">
				<view :class="PageCur=='studentInfo'?'text-blue':'text-gray'">
					<Am-FontAwesome  :class="PageCur=='studentInfo'?'fas fa-address-book':'far fa-address-book'"  class="cuIcon-calendar"  ></Am-FontAwesome>
					<text class=" text-lg padding">学生档案</text>
				</view>
			</view>
			<view class="action text-gray add-action "  @click="NavChange" data-cur="workbench">
				<button class="cu-btn  shadow" :class="PageCur=='workbench'?'cuIcon-homefill bg-blue':'cuIcon-home bg-grey'"></button>
				<text class=" text-lg ">工作台</text>
			</view>
			<view class="action" @click="NavChange" data-cur="my">
				<view :class="PageCur=='my'?'text-blue':'text-gray'">
					<text class="lg" :class="PageCur=='my'?'cuIcon-profilefill':'cuIcon-profile'"></text>
					<text class=" text-lg ">我的</text>
				</view>
			</view>
	
		</view>
	</view>
</template>

<script>
	import studentInfo from '@/pages/studentInfo/studentInfo'
	import person from '@/pages/user/person/person.vue'
	import workbench from '@/pages/workbench/workbench.vue'
	export default {
		components:{
			person,
			workbench,
			studentInfo
		},
		data() {
			return {
				PageCur: 'workbench'
			}
		},
		methods: {
			NavChange (e) {
				this.PageCur = e.currentTarget.dataset.cur
				if (this.PageCur === 'studentInfo') {
					this.$refs.studentInfo.getInfo()
				}
			}
		}
	}
</script>

<style>
.cu-tag.badge {
	right: 4px;
}
</style>